

import 'package:lcapp/tools/string_tool.dart';

class MapTool {
  //驼峰转化为下划线
  static Map<String,dynamic> camel2under(Map data) {
    return data.map((key, value) {
      String key1 = StringTool.camel2under(key);
      return MapEntry(key1, value);
    });
  }
  //下划线转化为驼峰命名
  static Map<String,dynamic> under2camel(Map data) {
    return data.map((key, value) {
      String key1 = StringTool.under2camel(key);
      return MapEntry(key1, value);
    });
  }
}